<!--原料档案模块-->
<template>
  <div  style="position: relative;">
    <mmTable ref="mmTable" :mmColumns="columns" :getUrl="url" :updateUrl="updateUrl" :delUrl="delUrl"
             :form="form" :formData="formData" v-on:formDataChange="formDataChange"
             :searchFormData="searchFormData" :searchForm="searchForm"
             :modalWidth="950">
      <Form slot="searchForm" ref="searchForm" :model="searchFormData" inline :label-width="70"  style="float: left">
        <FormItem label="用户名" prop="">
          <Input v-model="searchFormData.name" type="text" placeholder="" />
        </FormItem>
      </Form>
      <!--编辑添加模态框-->
      <Form  slot="editForm" :label-width="100" :model="formData" inline ref="editForm" :rules="formValidate">

        <Row>
          <Col :span="8">
          <FormItem label="编号" prop="billcode" style="width:300px">
            <Input v-model="formData.billcode" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="方案名" prop="name" style="width:300px">
            <Input v-model="formData.name" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="水份" prop="moisture" style="width:300px">
            <Input v-model="formData.moisture" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="8">
          <FormItem label="挥发份" prop="volatile" style="width:300px">
            <Input v-model="formData.volatile" type="text"  />
          </FormItem>
          </Col>

          <Col :span="8">
          <FormItem label="灰份" prop="ash" style="width:300px">
            <Input v-model="formData.ash" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="8">
          <FormItem label="硫份" prop="s" style="width:300px">
            <Input v-model="formData.s" type="text"  />
          </FormItem>
          </Col>

          <Col :span="8">
          <FormItem label="钒" prop="v" style="width:300px">
            <Input v-model="formData.v" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="24">
          <FormItem label="备注" prop="memo" style="width:913px">
            <Input v-model="formData.memo" type="textarea" height="200"/>
          </FormItem>
          </Col>
        </Row>

      </Form>
    </mmTable>
  </div>
</template>


<script>
  import mmTable from '../components/mmtable/mmtable.vue';
  export default {
    components: {
      mmTable
    },
    data () {
      /*显示列表*/
      return {
        columns:[
          {title: "编号",key: "billcode",width:200,align:'center'},
          {title: "方案名",key: "name",width:200,align:'center'},
          {title: "水份",key: "moisture",width:200,align:'center'},
          {title: "挥发份",key: "volatile",width:200,align:'center'},
          {title: "灰份",key: "ash",width:200,align:'center'},
          {title: "硫份",key: "s",width:200,align:'center'},
          {title: "钒",key: "v",width:200,align:'center'},
          {title: "备注",key: "memo",width:200,align:'center'}
        ],
        /*链接后台*/
        url:'/Recording/getList',
        updateUrl:'/Recording/Save',
        delUrl:'/Recording/Delete',
        form:{},
        formValidate:{
        },
        searchForm:{},
        searchFormData:{
          code:'',
          name:''
        },
        /*后台传的数据*/
        formData:{
          billcode:'',
          name:'',
          moisture:'',
          volatile:'',
          ash:'',
          s:'',
          v:'',
          memo:'',

          id:''
        },
        searchFormData:{
          name:""
        },
        searchForm:{}
      }
    },
    mounted () {
      this.form = this.$refs.editForm;
      this.searchForm = this.$refs.searchForm;
    },
    /*方法*/
    methods: {
      formDataChange(data){
        this.formData = data;
      }
    }
  }
</script>
<style>

</style>
